Repository navigation
Conversation
Use the same audited conversion as JSObjectGetPrivate: a finalizer may run after its Structure has been swept. Preserve all exactly-once and inactive-liveness assertions. Both native API cases pass in the address-sanitized build.
steipete
force-pushed
the
perf/worker-last-chance-sweep-release
branch
from
October 9, 2026 20:59
afa8d58 to
6754052
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Last-chance finalization clears the liveness bitmaps but marks their versions current, forcing generic sweep bookkeeping. Mark the already-empty maps stale so the existing all-dead specialization can run. Weak finalization and every non-zapped cell's original destructor stay in place, in the same order and on the same thread. Precise allocations and the decommitted-page fallback retain their paths.
The native probe invokes all 512 finalizers exactly once. The new-cell and prior-full-GC API regressions both pass under ASAN. The finalizer inspection uses JSC's documented finalization-safe conversion, preserving integrity checks without consulting an already-swept Structure. The test-only assertion failure, correction and review remain recorded.
Matched pinned-engine integration measurements put Linux synthetic last-chance finalization at 14.383→12.853 ms for this change alone; ordinary termination is 22.216→20.461 ms in the four-arm comparison. Real-module and Mac engine-only gains are much smaller/mixed. Companion openclaw/bun#154 removes the separate preliminary collection; its PR includes the fixed paired comparison table and reproducible synthetic fixture. No destructor omission or general Node parity is claimed.
Native integration uses the engine pinned when testing began plus this identical heap change and finalized oven-sh#152 ownership. Changed heap/test files match this release-line proposal byte-for-byte. Original callback/fd and SQLite gates pass; calibrated repeated-Worker ASAN comparisons add no new leak site. A separate full rebuild with the cache/parser fixes is clean under the inherited console suppression, including the unprimed external-string cache-key case. Those fixes are not included here.
Full Gateway AB/BA retains the original workload and 2,000 ms grace. All 80 Linux and 82 completed Mac workloads exit cleanly under the bound, without a kill attempt; two Mac setup failures remain in the record. Full-Gateway benefits are smaller and mixed by trace mode. This is integration evidence, not an assertion that this engine-only change accounts for the full difference.
The release branch's documentation-only preparation moved the Unreleased section. Rebase preserved released notes and the pending entry; range-diff confirms unchanged code/tests. Rebased P2 review is scoped-clean. At head
6754052ee963782bd2f7ac9769230fa1301d1d19, Linux native tests, macOS artifact build and Windows ARM64 build/native tests and native Linux ARM64 regressions pass. This draft is unmerged and publishes no artifact. Upstream searches found no equivalent empty-bitmap-version fix to port.